package com.xxh.market.dao.impl;

import cn.hutool.db.Db;
import cn.hutool.db.Entity;
import com.xxh.market.dao.OrderDetail;
import com.xxh.market.entity.Orderdetail;

import java.sql.SQLException;

public class OrderDetailimpl implements OrderDetail {

    //生成一条订单详情记录
    @Override
    public int insertOrderDetail(Orderdetail orderdetail) {

        try {
            int i = Db.use().insert(
                    Entity.create("orderdetail")
                            .set("oid", orderdetail.getOid())
                            .set("bid", orderdetail.getBid())
            );
            return  i;
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return 0;
    }
}
